//Cristian Moral Martos

package Ejercicio02;

import java.io.IOException;

import utils.ImagePGM;

/**
 * Exercise 2.3 Implement the following functions to compute the sup and inf of
 * two input images:
 * 
 * imSup (imageIn1, imageIn2, imageOut) // sup of images imageIn1 and imageIn2
 * imInf (imageIn1, imageIn2, imageOut) // inf of images imageIn1 and imageIn2/
 * 
 */
public class Ejercicio23 {

	public static void main(String[] args) throws IOException {

		// Recuperamos los paths de las imagenes a comparar
		String path1 = "input\\cam_74.pgm";
		ImagePGM image1 = new ImagePGM(path1);

		String path2 = "input\\cam_74.pgm";
		ImagePGM image2 = new ImagePGM(path2);

		String pathResultingImageSup = "output\\cam_74_supremum.pgm";
		String pathResultingImageInf = "output\\cam_74_infimum.pgm";

		image1.imageSupremum(image2).imageToFile(pathResultingImageSup);
		System.out.println("The supremum of images " + path1 + " and " + path2
				+ " is the image " + pathResultingImageSup);

		image1.imageInfimum(image2).imageToFile(pathResultingImageInf);
		System.out.println("The infimum of images " + path1 + " and " + path2
				+ " is the image " + pathResultingImageInf);

	}
}
